import request from '@/utils/request'
import { microservices } from '@/utils'

// ------------------------- 联系人分组 -------------------------
// 列表
export function getBsContactsGroup (params) {
  return request({
    url: `${microservices.pmsSms}/BsContactsGroup`,
    params
  })
}

// 新增
export function putBsContactsGroup (data) {
  return request({
    url: `${microservices.pmsSms}/BsContactsGroup`,
    data,
    method: 'put'
  })
}

// 修改
export function postBsContactsGroup (data) {
  return request({
    url: `${microservices.pmsSms}/BsContactsGroup`,
    data,
    method: 'post'
  })
}

// 删除
export function deleteBsContactsGroup (ids) {
  return request({
    url: `${microservices.pmsSms}/BsContactsGroup/${ids}`,
    method: 'delete'
  })
}

// ------------------------- 联系人 -------------------------
export function getBsContacts (params) {
  let sortStr = params.sortStr
  delete params.sortStr
  return request({
    url: `${microservices.pmsSms}/BsContacts?${sortStr}`,
    params
  })
}

// 新增
export function putBsContacts (data) {
  return request({
    url: `${microservices.pmsSms}/BsContacts`,
    data,
    method: 'put'
  })
}

// 修改
export function postBsContacts (data) {
  return request({
    url: `${microservices.pmsSms}/BsContacts`,
    data,
    method: 'post'
  })
}

// 删除
export function deleteBsContacts (ids) {
  return request({
    url: `${microservices.pmsSms}/BsContacts/${ids}`,
    method: 'delete'
  })
}

// 调整分组
export function postDoAdjustGroup (data) {
  return request({
    url: `${microservices.pmsSms}/BsContacts/doAdjustGroup`,
    data,
    method: 'post'
  })
}
